<div class="row">
    <div class="col-lg-12">
        <h3 class="page-header">Danh sách câu hỏi chưa trả lời</h3>
    </div>
</div>
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default"> 
            <div class="panel-body">               
                     <div class="table-reponsive">
                    <form name="add_question" id="add_question" action="<?php echo $this->url(array("action"=>"index")) ?>">
                        <table name="list_question" id="list_question" class="table table-hover">
                            <tr class="success">
                                    <th>Chọn</th><th>Tên người dùng</th><th>Tiêu đề</th><th>Câu hỏi</th>
                              </tr>
                              <?php 
                                 foreach($this->data as $item){
                                   echo " <tr>
                                        <td class=\"a\"id=\"abc".$item->getId()."\"><input type=\"checkbox\" name=\"select_question\"id=\"ck".$item->getId()."\"></td>
                                        <td class=\"u\">".GlobalLib::getName("user", $item->getUser_Id(), "username")."</td>
                                        <td class=\"t\">".$item->getTitle()."</td>
                                        <td class=\"q\" >".$item->getQuestion()."</td>
                                        </tr>";}
                               ?>
                              
                        </table>
                        <input type ="hidden" name="list_selectQuestion" id="list_selectQuestion" value="" >
                        <div class="form-group"><center>
                               <button type="submit" class="btn btn-default"id="submit">Chọn</button>
                               <button type="reset" class="btn btn-default" id="reset">Làm lại</button></center>
                        </div>
                    </form>    
                </div>
                <?php 
                   echo $this->paginationControl($this->data, 'Sliding' , 'feedback/pagination.phtml'); 
                ?>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript"> 
    <?php  foreach ($this->data as $item){ ?> 
     $("#ck"+"<?php echo $item->getId() ?>").click(function(){
          if( $("#ck"+"<?php echo $item->getId() ?>").is(':checked')){
             $("#list_selectQuestion").val($("#list_selectQuestion").val()+"<?php echo $item->getId()?>"+",");           
          }else{
              var t="<?php echo $item->getId()?>"+","; 
              var str = $("#list_selectQuestion").val();
                  str=str.replace(t,"");
              $("#list_selectQuestion").val(str);
          }
   });
    <?php }?>
</script>